﻿using System;
using System.Text;
using System.Security.Cryptography;

namespace Utilities
{
    public class SHA1Encryption
    {
        public static string EncodePasswordToBase64(string password)
        {
            byte[] bytes = Encoding.Unicode.GetBytes(password);
            SHA1 sha1 = new SHA1CryptoServiceProvider();
            return Convert.ToBase64String(sha1.ComputeHash(bytes));
            //byte[] dst = new byte[bytes.Length];
            ////Console.WriteLine(Convert.ToBase64String(dst));
            //byte[] inArray = HashAlgorithm.Create("SHA1").ComputeHash(dst);
            //return Convert.ToBase64String(inArray);
        }
    }
}
